﻿<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/common/session.jsp"%>
<!DOCTYPE html>
<HTML>
<HEAD>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=2.0, user-scalable=no, width=device-width">
    <TITLE>启辕汽车</TITLE>
    <link rel="stylesheet" type="text/css" href="${ctx}/css/menu.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/css/ext-all.css"/>
    <link href="../images/home/favicon.ico" rel="icon" type="image/x-icon" />
    <script type="text/javascript" src="${ctx}/js/menu.js"></script>
    <script type="text/javascript" src="${ctx}/js/ext-base.js"></script>
    <script type="text/javascript" src="${ctx}/js/ext-all.js"></script>
    <script type="text/javascript">
        var tabPanelCenter = new Ext.TabPanel({
            region:'center',
            deferredRender:false,
            enableTabScroll:true,
            activeTab:0,
            margins:'60 5 5 0',
            iconCls: 'tabs'
//            ,
//            items:[{
//                id:'home',
//                contentEl:'centerDiv',
//                title: '首页',
//                closable:false,
//                autoScroll:true
//            }]
        });
        Ext.onReady(function(){
            var viewport = new Ext.Viewport({
                layout:'border',
                maximizable: true,
                items:[
                    {
                        region:'west',
                        title:' ',
                        iconCls:'nav1',
                        width: 200,
                        collapsible: true,
                        split:true,
                        margins:'60 0 5 5',
                        layout:'accordion',
                        autoLoad: {url: "${ctx}/home/forward.jsp?url=${ctx}/home/accordion.jsp", callback: this.initSearch, scope: this},
                        layoutConfig:{
                            titleCollapse: true,
                            activeOnTop: true,
                            animate:true
                        }
//                        contentEl:'westDiv',
//                        items: [
//                            {
//                                title:'全部菜单',
//                                border:false,
//                                collapsible:true,
//                            }
                        <%--,--%>
                        <%--<c:forEach var="resource1" items="${securityAccount.resourceList}">--%>
                        <%--<c:if test="${resource1.resourceState == 1}">--%>
                        <%--{--%>
                        <%--id:${resource1.resourceId},--%>
                        <%--title:'${resource1.resourceName}',--%>
                        <%--border:false,--%>
                        <%--collapsible:false,--%>
                        <%--expanded: true,--%>
                        <%--iconCls:'${resource1.resourceIcon}',--%>
                        <%--items: [--%>
                        <%--<c:forEach var="resource2" items="${resource1.resourceList}">--%>
                        <%--{--%>
                        <%--id:${resource2.resourceId},--%>
                        <%--title:'${resource2.resourceName}',--%>
                        <%--border:false,--%>
                        <%--type: 'treepanel',--%>
                        <%--text:'${resource2.resourceUrl}',--%>
                        <%--listeners:{'click':{function(node, e){ alert(1);}}}--%>
                        <%--},--%>
                        <%--</c:forEach>--%>
                        <%--]--%>
                        <%--},--%>
                        <%--</c:if>--%>
                        <%--</c:forEach>--%>
//                        ]
                    },
                    tabPanelCenter]
            });
        });
        function addTab(uuid, tabTitle, targetUrl, closable){
            targetUrl = encodeURIComponent(targetUrl);
            tabPanelCenter.add({
                id:uuid,
                title: tabTitle,
                iconCls: 'tabs',
                autoLoad: {url: "${ctx}/home/forward.jsp?url=" + targetUrl, callback: this.initSearch, scope: this},
                closable:closable
            }).show();
        }
        addTab("home", "数据中心", "${ctx}/sale/src/index.html", false);

        function showMenuItem(uuid, tabTitle, targetUrl) {
            var tab = tabPanelCenter.getItem(uuid);
            if(tab){
                tabPanelCenter.setActiveTab(tab);
            }
            else{
                tab = addTab(uuid, tabTitle, targetUrl, true);
            }
        }

        function closeTab(uuid){
            var tab = tabPanelCenter.getItem(uuid);
            tabPanelCenter.remove(tab);
        }

        function closeAllTab(){
            if(confirm("确定关闭所有页签")){
                //循环遍历
                tabPanelCenter.items.each(
                        function(item){
                            if(item.closable){
                                //可以关闭的其他所有标签页全部关掉
                                tabPanelCenter.remove(item);
                            }
                        }
                );
            }
        }
    </script>
</HEAD>
<body style="background-color:#f0f7ff;">
<table cellpadding="0" cellspacing="0" border=0>
    <tr>
        <td>
            <%@include file="logo.jsp"%>
        </td>
    </tr>
</table>
</body>
</html>